#include <iostream>
#include <fstream>
#include <string>
#include "bundle/bundle.h"

using namespace std;

int main()
{
    string ifilename="jsonTest.cpp";
    string ofilename="output";

    ifstream ifs;
    ifs.open(ifilename,ios::binary);
    //获取压缩文件长度
    ifs.seekg(0,ios::end);
    size_t len=ifs.tellg();
    ifs.seekg(0,ios::beg);

    string tmp;
    tmp.resize(len);
    ifs.read(&tmp[0],len);

    string pack=bundle::pack(bundle::LZIP,tmp);//以LZIP方式压缩
    //cout<<pack;

    ofstream ofs;
    ofs.open(ofilename,ios::binary);
    ofs<<pack;

    ofs.close();
    ifs.close();
    return 0;
}

